#include "Regex2NFA2DFA.h"
#include <iostream>
#include <unistd.h>

using std::cout;

// Compile: g++ -o3 .\Regex2NFA2DFA.cpp .\main.cpp -o main.exe

int main()
{
	string regex = input_regex(); // (a|b)*a|bcd
	cout << "regex:" << regex << "\n\n";
	string separated_regex = add_separation(regex);
	cout << "separated_regex:" << separated_regex << "\n\n";
	string postfix_regex = to_postfix(separated_regex);
	cout << "postfix_regex:" << postfix_regex << "\n\n";

	cell NFA_cell = regex_to_nfa(postfix_regex);
	// cout << NFA_cell << "\n\n";

	Matrix nfa = cell2matrix(NFA_cell);
	// cout << nfa << "\n\n";

	Matrix dfa = NFA2DFA(nfa);
	// cout << dfa << "\n\n";

	Matrix dfa_m = DFA_minimize(dfa);
	cout << dfa_m << "\n\n";

	pause();

	return 0;
}